﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyThuVien;
using QuanLyThuVien.VO;
using QuanLyThuVien.BUS;

namespace QuanLyThuVien
{
    public partial class frmXoaDocGia : Form
    {
        public frmXoaDocGia()
        {
            InitializeComponent();
        }

        private void btnHuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnXoa_Click(object sender, EventArgs e)
        {
            busDocGia busDocGia = new busDocGia();
            DocGia DocGia = new DocGia(txtMaDocGia.Text, "");
            DataTable dt = busDocGia.TimDocGia(DocGia);
            if (dt == null || dt.Rows.Count == 0)
            {
                MessageBox.Show("Khong ton tai trong CSDL");
                return;
            }
            busDocGia.XoaDocGia(DocGia);
        }
    }
}
